﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
using System.Windows.Forms;
namespace NASM_Develop_IDE
{
    static class TextBoxHighlighter
    {
        [DllImport("user32.dll", CharSet = CharSet.Auto)]
        private static extern Int32 SendMessage(IntPtr hWnd, int msg,
        int wParam, [MarshalAs(UnmanagedType.LPWStr)] string lParam);
        private const int EM_SETCUEBANNER = 0x1501;
        public static bool Highlight(TextBox control, string text)
        {
            int returnVal = SendMessage(control.Handle, EM_SETCUEBANNER, 0, text);
            switch (returnVal)
            {
                case 0:
                {
                    return false;
                }
                case 1:
                {
                    return true;
                }
            }
            return false;
        }
      
    }
}
